# 此脚本用于删除data目录中所有运行结果文件

import os
import shutil

def remove_files(base, suffix):
    for name in os.listdir(base):
        path = base + name
        if path.endswith(suffix):
            print('File `' + path + '` is removed')
            os.remove(path)

def remove_dirs(base):
    for name in os.listdir(base):
        path = base + name
        if os.path.isdir(path):
            print('Directory `' + path + '` is removed')
            shutil.rmtree(path)

remove_files('data/raw_models/', '.pt')
remove_dirs('data/candidate_data/')
remove_dirs('data/adversarial_data/')
remove_files('data/enhanced_models/', '.pt')
